﻿using System;
using UnityEngine;
using FrameOperateSync;

class TestParser : IFrameParser
{
    public IRenderData FromBytes(byte[] data,Type type)
    {
        var str = System.Text.ASCIIEncoding.ASCII.GetString(data);
        return JsonUtility.FromJson(str, type) as IRenderData; //OperateData1.Create(Vector2.zero);
    }

    public byte[] ToBytes(IRenderData data)
    {
        return System.Text.ASCIIEncoding.ASCII.GetBytes(JsonUtility.ToJson(data));
    }
}

